@extends('layouts.master')

@section('title')
    产品分类管理——木投网商城管理后台
@stop

@section('app_css')
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/resource/css/style.css">
    <link rel="stylesheet" href="/resource/css/dataTables.bootstrap.css">
    <link rel="stylesheet" href="/resource/css/fileinput.min.css">
@stop

@section('app_js')
    <script src="/resource/js/jquery-1.11.3.min.js"></script>
    <script src="/resource/js/bootstrap.min.js"></script>
    <script src="/resource/js/fileinput.min.js"></script>
    <script src="/resource/js/fileinput_locale_zh.js"></script>
@stop

@section('content')
    @include('common.nav')
    <div class="container-fluid">
        <div class="row" id="navLeft">
            @@include('common.product_nav')
            <div class="col-lg-10">
                <div class="navbottom">
                    <span>您的位置：</span>商品 > 分类管理
                </div>
                <div class="contentNav">
                    <ul>
                        <li>商品分类</li>
                        <li class="btn btn-default"><a href="/show_goods_cate>管理</a></li>
                <li class="btn btn-default active"><a href="/add_goods_cate">新增</a></li>
                        <li class="btn btn-default"><a href="index_go.html">导出</a></li>
                        <li class="btn btn-default"><a href="index_enter.html">导入</a></li>
                        <li class="btn btn-default"><a href="index_tag.html">TAG管理</a></li>
                    </ul>
                </div>
                <hr>
                <div class="contentMember_new">
                    {{ Form::open(['url'=>'edit_goods_cate'])  }}
                    <table class="table table-hover">
                        <tbody>
                        <tr>
                            <th><span>*</span>分类名称：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text" class="input-small form-control" style="width:260px" name="cate_name" value="{{ $cate->cate_name }}"></th>
                        </tr>
                        <tr>
                            <th>上级分类：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <select class="form-control" style="width:260px;float:left;" name="parent_id">
                                    <option value="0">请选择...</option>
                                    @foreach($cates as $k => $c)
                                        <option value="{{ $c->cate_id }}" @if($cate->parent_id == $c->cate_id ) selected @endif>
                                            {{ str_repeat('&nbsp;&nbsp;',$cate->length) }}{{ $cate->cate_name }}</option>
                                    @endforeach
                                </select>
                            </th>
                        </tr>
                        <tr>
                            <th>深度:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <select class="form-control" style="width:260px;float:left;" name="length">
                                    <option value="0">请选择...</option>
                                    @foreach($levels as $k => $level)
                                        <option value="{{ $k }}" @if($cate->length == $k) selected @endif>{{ $level }}</option>
                                    @endforeach
                                </select>
                            </th>
                        </tr>
                        <tr>
                            <th>描述：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <textarea class="form-control" rows="3" style="width:260px;float:left;" name="description">{{ $cate->description }}</textarea>
                            </th>
                        </tr>
                        </tbody>
                    </table>
                    <button type="submit" class="btn btn-default">提交</button>
                    <input type="hidden" name="cate_id" value="{{ $cate->cate_id }}">
                    {{ Form::close() }}
                </div>
            </div>
        </div>
    </div>
@stop